/**
 * MGTV all right reserver
 */
package com.imgo.max.experience.service;

import com.imgo.max.artist.dto.DevoteInfo;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author peter.Y
 * @since 2016年4月22日
 */
@Component
public class DevoteRecordService {

    @Resource
    PracticerExperienceHandler pracExperienceHandler;

    @Resource
    UserExperienceHandler userExperienceHandler;

    //	@Transactional
    public void record(DevoteInfo devote) {

        if (devote.getType() == 0)  //“0”代表加粉丝，只增长艺人经验
        {
            devote.setDevoteValue(devote.getDevoteValue());
            pracExperienceHandler.handleMessage(devote);
        } else {
            pracExperienceHandler.handleMessage(devote);
            userExperienceHandler.handleMessage(devote);
        }
    }

}
